home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Celestin Apprentice 4
/
Apprentice-Release4.iso
/
Source Code
/
Libraries
/
Graphic Elements 3
/
GESound
/
GESound.h
< prev
Wrap
Text File
|
1995-05-25
|
2KB
|
111 lines
/*
GESound.h
Asynch sound player for use with Graphic Elements
Version 1.0b1
Requires Sound Manager 3.0 or later
Copyright 1995 by Al Evans. All rights reserved.
3/10/95
*/
#ifndef GESOUND
#define GESOUND
#include "List.h"
#include <Sound.h>
#ifdef __cplusplus
extern "C" {
#endif
typedef struct {
SndChannelPtr channel;
unsigned long playTime;
short priority;
short sndNum;
} GESndChan, *GESndChanPtr;
typedef struct {
LHeaderPtr soundsLoaded;
long soundEnabled;
short nChannels;
short nCurrent;
SndCallBackUPP soundCallBack; // So we can dispose it properly for PowerMac
GESndChan soundChannel[];
} GESoundsRec, *GESoundPtr;
/*
Call once to create and initialize a Graphic Elements sounds record.
nSoundChannels is the maximum number of sounds that will be played at
the same time.
*/
GESoundPtr GEInitSounds(short nSoundChannels);
/*
Enable and disable sound play.
*/
void GEnableSound(GESoundPtr sounds, Boolean enableIt);
/*
Schedule a sound to play in msDelay milliseconds. sndResID is the resource
number of the sound to be played. The sound will actually be played only if
a sound channel is available with a current priority < priority.
*/
OSErr GEScheduleSound(GESoundPtr sounds, short sndResID, short priority,
unsigned long msDelay);
/*
Make sound data memory-resident (keepInMemory == true) or
purgeable (keepInMemory == false).
*/
void GEHoldSound(GESoundPtr sounds, short sndResID, Boolean keepInMemory);
/*
Must be called periodically (for example, once each time through main event loop)
to play scheduled sounds and manage sound memory allocation.
*/
void GESoundMaintenance(GESoundPtr sounds);
/*
Returns true if sound with resource # sndResID is currently playing.
*/
Boolean GESoundPlaying(GESoundPtr sounds, short sndResID);
/*
Stops sound with resource # sndResID immediately
*/
void GEStopOneSound(GESoundPtr sounds, short sndResID);
/*
Stops ALL sounds immediately.
*/
void GEStopAllSounds(GESoundPtr sounds);
/*
Call when completely finished with sounds. Frees all memory allocated in
GEInitSounds().
*/
void GEDisposeSounds(GESoundPtr sounds);
#ifdef __cplusplus
}
#endif
#endif